//
//  LLRefreshConst.h
//  AnimateTest
//
//  Created by dl on 15/12/10.
//  Copyright © 2015年 dl. All rights reserved.
//

#import <Foundation/Foundation.h>

#import <UIKit/UIKit.h>
#import <objc/message.h>

// 日志输出
#ifdef DEBUG
#define LLRefreshLog(...) NSLog(__VA_ARGS__)
#else
#define LLRefreshLog(...)
#endif

// 过期提醒
#define LLRefreshDeprecated(instead) NS_DEPRECATED(2_0, 2_0, 2_0, 2_0, instead)

// 运行时objc_msgSend
#define LLRefreshMsgSend(...) ((void (*)(void *, SEL, UIView *))objc_msgSend)(__VA_ARGS__)
#define LLRefreshMsgTarget(target) (__bridge void *)(target)

// RGB颜色
#define LLRefreshColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]

// 文字颜色
#define LLRefreshLabelTextColor LLRefreshColor(90, 90, 90)

// 字体大小
#define LLRefreshLabelFont [UIFont boldSystemFontOfSize:14]

// 常量
#define LLRefreshHeaderHeight               70.f
#define LLRefreshFooterHeight               44.0
#define LLRefreshFastAnimationDuration      0.25f
#define LLRefreshSlowAnimationDuration      0.4f

#define LLRefreshKeyPathContentOffset       @"contentOffset"
#define LLRefreshKeyPathContentInset        @"contentInset"
#define LLRefreshKeyPathContentSize         @"contentSize"
#define LLRefreshKeyPathPanState            @"state"

// 状态检查
#define LLRefreshCheckState \
LLRefreshState oldState = self.state; \
if (state == oldState) return; \
[super setState:state];
